function entgen = ddtent(attract,rho,obasis,coef)
nd=size(rho,1);omsc=0;gamsc=0;
raux = liouv(nd,rho,omsc,gamsc,obasis,coef);
%e1=eigs(attract);
%e2=eigs(rho);
%if (min(e1)<0)
%    a1=logm(attract);
%    abs(trace(attract'*expm(a1)))
%end
entgen = -trace(raux*(logm(rho)-logm(attract)));
